package com.fanfanwang.ffw.app.ui.service;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ListView;

import com.fanfanwang.ffw.app.AppManager;
import com.fanfanwang.ffw.app.adapter.ZhiHangListAdapter;
import com.fanfanwang.ffw.app.bean.ServiceBean;
import com.fanfanwang.ffw.app.tenant.R;
import com.fanfanwang.ffw.app.widget.CommonTitleBar;

/** 注册 */
public class ZhiHangAct extends com.fanfanwang.ffw.app.base.BaseActivity {

	private CommonTitleBar commonTitleBar;
	private ZhiHangListAdapter zhihangListAdapter;
	private ArrayList<ServiceBean> ZhiHangLists;
	private ListView listview;
	private Activity mAct;
	private Intent mIntent;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		initWidget();
		initData();
		AppManager.getAppManager().addActivity(this);
		widgetClick();
	}

	public void initWidget() {
		setContentView(R.layout.activity_service_zhihang);
		mAct = this;
		commonTitleBar = (CommonTitleBar) findViewById(R.id.common_titlebar);
		listview=(ListView)findViewById(R.id.zhihang_listView);
		ZhiHangLists=new ArrayList<ServiceBean>();

	}

	public void widgetClick() {
		commonTitleBar.setToolBarReturnOnclickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				finish();
			}
		});
	}

	@Override
	public void initData() {
		commonTitleBar.setCenterText(getString(R.string.zhihang));
		commonTitleBar.setReturnVisible();
		getListData();
		zhihangListAdapter=new ZhiHangListAdapter(mAct, ZhiHangLists);
		listview.setAdapter(zhihangListAdapter);
		}


	@Override
	protected void initView() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void setListener() {
		// TODO Auto-generated method stub

	}
	public void getListData(){
		ServiceBean serviceBean1=new ServiceBean();
		serviceBean1.serviceTitle=getString(R.string.qianghai_title);
		serviceBean1.serviceContent=getString(R.string.qianghai_content);
		ServiceBean serviceBean2=new ServiceBean();
		serviceBean2.serviceTitle=getString(R.string.nanshan_title);
		serviceBean2.serviceContent=getString(R.string.nanshan_content);
		ZhiHangLists.add(serviceBean1);
		ZhiHangLists.add(serviceBean2);
	}
}
